<?php
/* SVN FILE: $Id: coach.php 327 2010-07-20 12:00:55Z gregory.rome $ */
/**
 * Model.
 *
 * @todo Add file description.
 *
 * cBBweb : Digital Blood Bowl league interface (http://code.google.com/p/cbbweb/)
 * Copyright 2009-2010, Grégory Romé.
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2009-2010, Grégory Romé.
 * @link          http://code.google.com/p/cbbweb/ cBBweb Project
 * @package       cbbweb
 * @subpackage    cbbweb.models
 * @version       $Revision: 327 $
 * @modifiedby    $LastChangedBy: gregory.rome $
 * @lastmodified  $Date: 2010-07-20 12:00:55 +0000 (Tue, 20 Jul 2010) $
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */

/**
 * Model.
 *
 * @todo Add model description.
 *
 * @package       cbbweb
 * @subpackage    cbbweb.controllers
 */
class Coach extends AppModel {

	var $name = 'Coach';
	var $primaryKey = 'ID';
	var $useTable = 'coach';
	var $order = array("Coach.strName COLLATE NOCASE" => "asc");

	var $hasOne = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'coach_id',
			'fields' => array('User.id','User.username'),
			'dependent' => false,
		),
		'StatisticsCoach' => array(
			'className' => 'StatisticsCoach',
			'foreignKey' => 'idCoach',
			'dependent' => false,
		)
	);

	var $hasMany = array(
		'Team' => array(
            'className'     => 'Team',
            'foreignKey'    => 'idCoach',
            'dependent'		=> false
		)
	);

}
?>